def fact(n):  # 递归算阶乘
    if n == 0:
        return 1
    else:
        return n * fact(n - 1)


print(fact(5))


def rvs(s):  # 字符串反转后输出
    if s == "":
        return s
    else:
        return rvs(s[1:]) + s[0]


print(rvs("abcdefg"))


def f(n):  # 斐波那契数列
    if n == 1 or n == 2:
        return 1
    else:
        return f(n - 1) + f(n - 2)


print(f(20))
